﻿<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！-->
    <title>学生惠后台管理系统</title>
    <link rel="stylesheet" href="/App/Admin/public/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/App/Admin/public/css/style.css"/>
</head>
<body>
<div class="mainBody">
    <include file="Public:left"/>
    <div class="main">
        <include file="Public:top"/>
        <div class="subNav">
            <span class="text"><i class="iconFont">&#xe600;</i>管理员账号 - 新增</span>
        </div>

        <div class="indexBox">
            <div class="con-det">
                <div class="row">
                    <div class="col-md-12">
                        <form id="commentForm">
                            <table class="formTable editForm">
                                <tr>
                                    <td class="noBor" valign="top">管理员账号</td>
                                    <td class="noBor" valign="top"><input type="text"  id="username" class="inp form-control"></td>
                                    <td class="noBor"></td>
                                    <td class="noBor" valign="top">管理员密码</td>
                                    <td class="noBor" valign="top"><input type="password" id="password" class="inp form-control"></td>
                                </tr>
                                <tr>
                                    <td valign="top">管理员姓名</td>
                                    <td valign="top"><input type="text" id="fullname"  class="inp form-control"></td>
                                    <td></td>
                                    <td valign="top">管理员电话</td>
                                    <td valign="top"><input type="text"  id="phone"class="inp form-control"></td>
                                </tr>
                                <tr>
                                    <td class="textAliRi" colspan="5">
                                        <button class="btn btn-primary blue" type="submit">保存</button> 
                                        <a href="{:U('Rule/index')}" class="btn btn-default" type="button">返回</a>
                                    </td>
                                </tr>
                            </table>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" src="/App/Admin/public/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="/App/Admin/public/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/App/Admin/public/js/public.js"></script>


<script type="text/javascript">
	$('.btn-primary').on('click',function(){
	
	var username = $('#username').val();
	/*var  level = $('#level').val();*/
        var phone = $('#phone').val();
        var password = $('#password').val();
	/*var passtwice = $('#passtwice').val();*/
	var fullname = $('#fullname').val();
	
	
	 if( username == ''){
	    alert("账号不能为空");
		return false;
	    }
         if( password == ''){
	   alert("密码不能为空");
	   return false;
	    }
	
	 /*if( passtwice == ''){
	   alert("确认密码不能为空");
	   return false;
	    }
         if( password != passtwice){
          alert('确认密码与首次密码输入不符');
	  return false;
         }*/
	
	
	 if( fullname == ''){
	   alert("姓名不能为空");
	   return false;
	    }


        if( phone == ''){
	    alert("电话不能为空");
	    return false;
	    }
  $.post('{:U("Rule/save")}',{username:username,phone:phone,password:password,fullname:fullname},function(data){
		  if(data.status==100){
		 	window.location='{:U("Rule/index")}';
			   }else{
			window.location='{:U("Rule/index")}';
				 }
		 })
	
	
});
	</script>
</body>
</html>








